const router = require('koa-router')()

router.prefix('/auth')

router.get('/', async (ctx, next) => {
    await ctx.render('index', {
        title: 'fac后台接口'
    })
})
router.get('/:auth', async (ctx, next) => {
    await ctx.render('index', {
        title: "asdf"+ctx.params.auth
    })
})

router.get('/string', async (ctx, next) => {
    ctx.body = 'koa2 string'
})

router.get('/json', async (ctx, next) => {
    ctx.body = {
        title: 'koa2 json'
    }
})

module.exports = router